﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace SimpleRest.Core.Extensions.OAuth
{
    public interface IAuthorizationAuthority
    {        
        /// <summary>
        /// Resolve authority of a request from a passed in MAC token.  MAC token RFC can be located here http://tools.ietf.org/html/rfc6750
        /// </summary>
        /// <param name="bearerToken"></param>
        /// <param name="protectedResource"></param>
        /// <param name="targetOperation"></param>
        /// <returns></returns>
        bool IsAuthorized(BearerToken bearerToken, string protectedResource, Operation targetOperation);

        /// <summary>
        /// Resolve authority of a request from a passed in Bearer token.  The bearer token value should contain the access token
        /// given to a consumer in a prior request.
        /// </summary>
        /// <param name="token"></param>
        /// <param name="protectedResource"></param>
        /// <param name="targetOperation"></param>
        /// <returns></returns>
        bool IsAuthorized(MacToken token, string protectedResource, Operation targetOperation);
    }
}
